var util = require('../../libs/util.js');
var bdParse = require('../../bdParse/bdParse.js');
Page({
    data: {
    	id: null,
    	article: {},			// 文章信息
        detail: ''
    },
    onLoad: function(e) {
        swan.showNavigationBarLoading();
    	this.setData({id: e.id});
        this.init();
    },
    init: function() {
        var _this = this;
    	// 文章内容
    	util.request({
            url: 'goods.goods/detail',
            method: 'POST',
            data: {
                goods_id: this.data.id
            },
            success: function (res) {
                bdParse.bdParse('detail', 'html', res.result.content, _this, 5);
                _this.setData({article: res.result})
                swan.hideNavigationBarLoading();
                swan.setNavigationBarTitle({title: res.result.name});
            }
        });
    }
})